package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysRoleGroupDAO;
import com.pmh.hrs.sys.service.SysRoleGroupService;
import com.pmh.hrs.sys.vo.SysRoleGroupVO;

@Service("sysRoleGroupService")
public class SysRoleGroupServiceImpl implements SysRoleGroupService{

	@Resource(name="sysRoleGroupDAO")
	private SysRoleGroupDAO sysRoleGroupDAO;
	
	
	private SysRoleGroupVO convertSysRoleGroupVO(Map<String,Object> paramMap) throws Exception{
		SysRoleGroupVO sysRoleGroupVO = new SysRoleGroupVO();
		BeanUtils.copyProperties(paramMap, sysRoleGroupVO);
		return sysRoleGroupVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysRoleGroupVO sysRoleGroupVO =  this.convertSysRoleGroupVO(paramMap);
		return sysRoleGroupDAO.insert(sysRoleGroupVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysRoleGroupVO sysRoleGroupVO =  this.convertSysRoleGroupVO(paramMap);
		return sysRoleGroupDAO.update(sysRoleGroupVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysRoleGroupDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysRoleGroupDAO.selectList(paramMap);
	}

}
